Improve list/download robustness (pagination, retries, per-camera summary)#16
Improve list/download robustness (pagination, retries, per-camera summary)#16JorisLimousin wants to merge 5 commits intodimme:mainfrom
Conversation
|
This smells like AI |
|
The description is and I used it to help me fix these issues but I've been debugging manually and it took me over 2 days to download all videos (I have 2 cameras) with about 7000 each for a month. I actually went to great length to get this PR in because I had no environment setup on that machine, but thought it might help people to get these fixes in so took the time to make the PR. If you have over 3000 videos the default page length simply doesn't work, you get a 500 internal error from Tapo's API. |
|
Also got some weird issues with the S3 signed URLs, not exactly sure why they happen but adding retries helps sort it out. Could be related to my own home internet speed though, either way I thought it was still useful to incorporate. |
Honestly, once AI will carry out videos download (instead of me), this piece of code may smell till end of the world (far away)... |
Improve
list-videosanddownload-videosreliability (pagination, retries, per-camera summary)Summary
This PR improves the reliability and usability of the
list-videosanddownload-videoscommands, especially when downloading a large number of videos (e.g., last 30 days) where the Tapo API may intermittently fail.Changes
Pagination for
/v2/videos/listpageSizefrom 3000 → 1000 to avoid intermittent HTTP 500 errors from the Tapo cloud APIResilient downloads with retry logic
ChunkedEncodingError/ConnectionErrorPer-camera result summary
Shows, for each camera:
--overwrite 0)Helps users quickly validate the outcome and rerun if needed
Fixed UTC deprecation warning
datetime.datetime.utcfromtimestamp()withdatetime.datetime.fromtimestamp(..., datetime.timezone.utc)Impact
These updates significantly improve the stability of large download operations from the Tapo Cloud, especially over slower or inconsistent network connections. The CLI now:
Compatibility